package com.violet.domain.vo.manager;

import com.violet.annotation.transition.TDateTimeFormat;
import com.violet.annotation.transition.TImagePrefix;
import com.violet.domain.vo.VO;
import lombok.Data;

import java.util.List;

@Data
public class MOrderVo implements VO {

    private String id;
    @TDateTimeFormat
    private String orderTime;
    @TDateTimeFormat
    private String deliveryTime;
    private Double finalPrice;
    private String status;

    private MOrderVo.MOrderUser user;
    private MOrderVo.MOrderRider rider;
    private MOrderVo.MOrderAddress address;
    private List<MOrderVo.MOrderProduct> products;

    // 下单用户
    @Data
    public static class MOrderUser implements VO {
        private String id;
        private String username;
        private String phone;
        @TImagePrefix
        private String image;
    }

    // 订单骑手
    @Data
    public static class MOrderRider implements VO {
        private String id;
        private String name;
        private String phone;
    }

    // 订单地址
    @Data
    public static class MOrderAddress implements VO {
        private String name;
        private String phone;
        private String address;
    }

    // 订单商品
    @Data
    public static class MOrderProduct implements VO {
        private String id;
        private String name;
        private String description;
        private Double currentPrice;
        private Double originalPrice;
        private Integer count;
        @TImagePrefix
        private String image;
    }
}
